using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShootThemUp.Sources.AudioElements;
using Microsoft.Xna.Framework.Media;

namespace ShootThemUp.Sources.Screens
{
    /// <summary>
    /// This screen comes up when the player dead.
    /// </summary>
    class PlayerDeathScreen : MenuScreen
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PlayerDeathScreen"/> class.
        /// </summary>
        /// <param name="Score">The player score.</param>
        public PlayerDeathScreen(int score) : base("Game Over")
        {
            MenuEntries.Add(new MenuEntry("You Died !"));
            MenuEntries.Add(new MenuEntry("Score: " + score));
            MenuEntries.Add(new MenuEntry(""));
            MenuEntries.Add(new MenuEntry("Press back to quit"));

            Audio audio = Audio.GetInstance;
            MediaPlayer.Play(audio.End);
        }

        /// <summary>
        /// Handler for when the user has cancelled the menu.
        /// </summary>
        /// <param name="playerIndex"></param>
        protected override void OnCancel(Microsoft.Xna.Framework.PlayerIndex playerIndex)
        {
            LoadingScreen.Load(ScreenManager, false, ControllingPlayer, new BackgroundScreen(@"Menus\Textures2D\backgroundMenu"), new MainMenuScreen(GameStateManagement.APP_NAME));
        }

        
    }
}
